{if $TS_USER['userid']}

<div class="card">
<div class="card-body">
<div class="facebox">
<div class="face">
<a href="{tsUrl('user','space',array('id'=>$strUser['userid']))}"><img class="rounded-circle" title="{$strUser[username]}" alt="{$strUser[username]}" src="{$strUser[face]}" width="36"></a>
</div>

<div class="info">
{$strUser[username]}
<div>


<a class="fs12 text-info" href="{tsUrl('user','space',array('id'=>$strUser['userid']))}"><i class="bi bi-person-bounding-box"></i> 访问我的空间</a>


</div>
</div>

<div class="clear"></div>

<ul class="other">
<li class="br"><span class="fs14"><a href="{tsUrl('user','group',array('id'=>$strUser['userid']))}">{$strUser['count_group']}</a></span><br />小组</li>
<li class="br"><span class="fs14"><a href="{tsUrl('user','topic',array('id'=>$strUser['userid']))}">{$strUser['count_topic']}</a></span><br />帖子</li>
<li class="br"><span class="fs14"><a href="{tsUrl('user','followed',array('id'=>$strUser['userid']))}">{$strUser['count_followed']}</a></span><br />粉丝</li>
<li><span class="fs14"><a href="{tsUrl('user','follow',array('id'=>$strUser['userid']))}">{$strUser['count_follow']}</a></span><br />关注</li>
</ul>

<div class="clear"></div>

<div class="fmore">

<a href="{tsUrl('user','verify')}">{if $strUser['isverify']==1}<img src="{SITE_URL}public/images/rz1.png" width="20" alt="通过Email认证" title="通过Email认证" align="absmiddle" />{else}<img src="{SITE_URL}public/images/rz2.png" width="20" alt="未通过Email认证" title="未通过Email认证" align="absmiddle" />{/if}</a>

    {if $strUser['isrenzheng']==1}
    <img src="{SITE_URL}public/images/renzheng1.png" width="20" height="20" alt="通过人工认证" title="通过人工认证" />
    {else}
    <img src="{SITE_URL}public/images/renzheng2.png" width="20" height="20" alt="未通过人工认证" title="未通过人工认证" />
    {/if}

<br />
角色：<a href="{tsUrl('user','role')}">{$strUser['rolename']}</a> <span style="padding-left:30px;">积分：<a href="{tsUrl('my','score')}">{$strUser['count_score']}</a></span>

</div>
</div>

<div class="mt-3">
    <a class="btn btn-block btn-info btn-lg" href="{tsUrl('topic','group')}"><i class="bi bi-chat-square-text"></i> 我要发贴</a>
</div>

</div>
</div>


{else}

<div class="card">
<div class="card-body">
<div class="login">
<div>

<legend>登录</legend>
<div class="form-group">
<label>账号:</label>
<br />
<input class="form-control" type="text" name="email" placeholder="Email/手机号">
</div>
<div class="form-group">
<label>密码：</label>
<br />
<input class="form-control" type="password" name="pwd">
</div>


<input type="hidden" name="cktime" value="2592000" />
<input type="hidden" name="token" value="{$_SESSION['token']}" />
<button id="comm-submit" type="button" class="btn btn-sm btn-info">登 录</button>

    <a class="btn btn-sm text-black-50" href="{tsUrl('user','register')}">还没有注册？</a>



</div>

    <div class="tac lh30">
        {php doAction('home_login')}
    </div>

</div>
</div>
</div>




<!--{if $TS_SITE['is_vaptcha']}-->
<script src="https://v.vaptcha.com/v3.js"></script>
<script>
vaptcha({
    vid: '{$TS_SITE[vaptcha_vid]}',// 验证单元id
    mode: 'invisible',// 显示类型 隐藏式
    scene: 0,// 场景值 默认0
    area: 'auto' //验证节点区域,默认 auto,可选值 auto,sea,na,cn
}).then(function (vaptchaObj) {

    obj = vaptchaObj; //将VAPTCHA验证实例保存到局部变量中

    vaptchaObj.listen("pass", function () {
        // 验证成功进行后续操作
        var email = $("input[name='email']").val();
        var pwd = $("input[name='pwd']").val();
        var cktime = $("input[name='cktime']").val();
        var jump = $("input[name='jump']").val();
        var token = $("input[name='token']").val();
    
        serverToken = vaptchaObj.getServerToken()
    
        var data = {
            email:email,
            pwd:pwd,
            cktime:cktime,
            jump:jump,
            token:token,
            vaptcha_token: serverToken.token,
            vaptcha_server: serverToken.server,
        };
        tsPost('index.php?app=user&ac=login&ts=do&js=1',data)
        vaptchaObj.reset(); //重置验证码
        
    });

    //关闭验证弹窗时触发
    vaptchaObj.listen("close", function () {
        //验证弹窗关闭触发
    });

})

$("#comm-submit").on("click", function () {

    var email = $("input[name='email']").val();
    var pwd = $("input[name='pwd']").val();

    if(email && pwd){
        //人机验证
        obj.validate();
    }else{
        tsNotice('账号和密码必须输入！');
    }

    
});
</script>

<!--{else}-->

<script>
    $("#comm-submit").on("click", function () {
        var email = $("input[name='email']").val();
        var pwd = $("input[name='pwd']").val();
        var cktime = $("input[name='cktime']").val();
        var jump = $("input[name='jump']").val();
        var token = $("input[name='token']").val();

        if(email && pwd){
            var data = {
                email:email,
                pwd:pwd,
                cktime:cktime,
                jump:jump,
                token:token,
            };
            tsPost('index.php?app=user&ac=login&ts=do&js=1',data)
        }else{
            tsNotice('账号和密码必须输入！');
        }
    
    });
</script>

<!--{/if}-->



{/if}